package com.youoor.service.impl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.youoor.common.base.BaseDao;
import com.youoor.common.base.BaseServiceImpl;
import com.youoor.dao.UserDao;
import com.youoor.domain.Account;
import com.youoor.domain.UserInfo;
import com.youoor.domain.UserInfoQuery;
import com.youoor.service.UserService;

@Service(value="userService")
public class UserServiceImpl extends BaseServiceImpl<UserInfo,UserInfoQuery,Integer> implements UserService {
	private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

	@Resource(name = "userDao")
	private UserDao userDao;
	

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public BaseDao<UserInfo, UserInfoQuery, Integer> getBaseDao() {
		return userDao;
	}

	@Override
	public Long register(Account account) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public UserInfo login(String userName, String password) {
		// TODO Auto-generated method stub
		return userDao.verifyUser(userName, password);
	}

	@Override
	public void resetPass(int userId, String newPass) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public UserInfo getUserByName(String userName) {
		// TODO Auto-generated method stub
		return userDao.getUserByName(userName);
	}

	@Override
	public UserInfo getUserByEmail(String email) {
		// TODO Auto-generated method stub
		return userDao.getUserByEmail(email);
	}




}
